//
//  FPdirectorModel.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/21.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

#import "FPdirectorModel.h"

@implementation FPdirectorModel
- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

+ (FPdirectorModel *)directorModelWithDic:(NSDictionary *)dic
{
    FPdirectorModel *model = [[FPdirectorModel alloc]init];
    NSArray *typeArr = dic[@"types"];
    NSDictionary *dirDic  = typeArr[0];
    {
        NSArray *perdir = dirDic[@"persons"];
        NSDictionary *dirppp = perdir[0];
        model.directorImage = dirppp[@"image"];
        model.directorName = dirppp[@"name"];
        model.directorEn = dirppp[@"nameEn"];
        
    }
    NSDictionary *actdic = typeArr[1];
    {
        NSArray *actrr = actdic[@"persons"];
        NSDictionary *act1dic = actrr[0];
        {
            model.actor1Name = act1dic[@"name"];
            model.actor1Image = act1dic[@"image"];
            model.personate1Name = act1dic[@"personateCn"];
            model.actor1Roleimage = act1dic[@"roleCover"];
            NSLog(@"%@",model.actor1Roleimage);
        }
        if (actrr.count > 1) {
            
            NSDictionary *act2dic = actrr[1];
            {
                model.actor2Name = act2dic[@"name"];
                model.actor2Image = act2dic[@"image"];
                model.personate2Name = act2dic[@"personateCn"];
                model.actor2Roleimage = act2dic[@"roleCover"];
                NSLog(@"%@",model.actor2Roleimage);
                
                
            }
        }
       
    }
    if (typeArr.count > 2) {
        
        NSDictionary *writerdic = typeArr[2];
        {
            
            NSArray *writeArr = writerdic[@"persons"];
            NSDictionary *write1Dic = writeArr[0];
            
            model.writer1Name = write1Dic[@"name"];
            NSLog(@"%@",model.writer1Name);
            
            
        }
    }
    
   else if (typeArr.count > 3) {
        NSDictionary *productdic = typeArr[3];
        {
            NSArray *productArr = productdic[@"persons"];
            NSDictionary *product1Dic = productArr[0];
            {
                model.produced1Name = product1Dic[@"name"];
                model.producedNameEN = product1Dic[@"nameEn"];
            }
            
            
            
        }
    }
    
   
    return model;
    
}
@end
